Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contributing back jpgimenez changes to cbpi3 #258

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

jpgimenez
Copy link

@jpgimenez jpgimenez commented Aug 2, 2020

master branch includes the following changes:

If you want to use this changes on your cbpi installation, download the patch https://patch-diff.githubusercontent.com/raw/Manuel83/craftbeerpi3/pull/258.patch and apply it.

Juan Pablo Giménez and others added 23 commits November 14, 2019 09:11
- create DummyPWM for PWM testing
….8.2.post1

Bump python-engineio from 0.9.2 to 3.8.2.post1
Remove hardcoded http protocol for polling.
bundle.js are using location.protocol instead of "http://" now.
@jpgimenez jpgimenez changed the title upgrade deps Contributing back jpgimenez changes to cbpi3 Aug 4, 2020
@avollkopf
Copy link

Graphs are not diplayed with python 3. --> modules/log/endpoints.py requires change in line 59:
'''
import csv

    array = []

    with open(filename, 'rt', encoding='utf-8') as f:

        reader = csv.reader(f)

'''

@jpgimenez
Copy link
Author

charts fixed df8c6a7

Graphs are not diplayed with python 3. --> modules/log/endpoints.py requires change in line 59:
'''
import csv

    array = []

    with open(filename, 'rt', encoding='utf-8') as f:

        reader = csv.reader(f)

'''

@lalo-uy
Copy link

lalo-uy commented Aug 9, 2020

I have added some code to display only one point per minute.
Now loads ok a 5 days fermentation graph.

import csv
        array = []
        with open(filename, 'rb') as f:
            reader = csv.reader(f)
            l_time=0
            for row in reader:
                try:
                    p_time=int((datetime.datetime.strptime(row[0], "%Y-%m-%d %H:%M:%S") - datetime.datetime(1970, 1, 1)).total_seconds()) * 1000
                    if ( abs(float(row[1])) < 100 ) and ( p_time >= l_time ):
                        l_time = p_time + 60000;
                        array.append([p_time , float(row[1])])
                except:
                    pass
        return array

Also on lines 80 and 121 of Modules/core/controler.py added tank name in the bottom of the graph.

 80         result.append({"name": kettle.name+" Temp", "data_type": "sensor", "data_id": kettle.sensor})

121              result.append({"name": fermenter.name+" Temp", "data_type": "sensor", "data_id": fermenter.senso
r})

@avollkopf
Copy link

fermenter.py causes an error:
File "/home/pi/craftbeerpi3/modules/fermenter/init.py", line 187, in start_fermentation
inactive.direction = "C" if current_temp >= inactive.temp else "H"
TypeError: '>=' not supported between instances of 'float' and 'str'

-> fix:
inactive.direction = "C" if float(current_temp) >= float(inactive.temp) else "H"

* add Vagrantfile to test installation
@jpgimenez
Copy link
Author

fermenter.py causes an error:
File "/home/pi/craftbeerpi3/modules/fermenter/init.py", line 187, in start_fermentation
inactive.direction = "C" if current_temp >= inactive.temp else "H"
TypeError: '>=' not supported between instances of 'float' and 'str'

-> fix:
inactive.direction = "C" if float(current_temp) >= float(inactive.temp) else "H"

I use cbpi only to brew, I ferment with brewpiless, but I'll try to fix this...

@jpgimenez
Copy link
Author

I have added some code to display only one point per minute.
Now loads ok a 5 days fermentation graph.

import csv
        array = []
        with open(filename, 'rb') as f:
            reader = csv.reader(f)
            l_time=0
            for row in reader:
                try:
                    p_time=int((datetime.datetime.strptime(row[0], "%Y-%m-%d %H:%M:%S") - datetime.datetime(1970, 1, 1)).total_seconds()) * 1000
                    if ( abs(float(row[1])) < 100 ) and ( p_time >= l_time ):
                        l_time = p_time + 60000;
                        array.append([p_time , float(row[1])])
                except:
                    pass
        return array

Also on lines 80 and 121 of Modules/core/controler.py added tank name in the bottom of the graph.

 80         result.append({"name": kettle.name+" Temp", "data_type": "sensor", "data_id": kettle.sensor})

121              result.append({"name": fermenter.name+" Temp", "data_type": "sensor", "data_id": fermenter.senso
r})

could you create a PR against my branch? or maybe send me a patch...

@avollkopf
Copy link

I use cbpi only to brew, I ferment with brewpiless, but I'll try to fix this...

ok, i changed the code yesterday to the line i posted and the error was gone

@lalo-uy
Copy link

lalo-uy commented Aug 10, 2020 via email

jpgimenez and others added 4 commits August 10, 2020 20:17
Remove reference to w1_bus_master1 since sensors could be no several bus masters like
# CraftBeerPi 1-wire support
dtoverlay=w1-gpio,gpiopin=4
dtoverlay=w1-gpio,gpiopin=27
dtoverlay=w1-gpio,gpiopin=18
:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants